package 反射.代理模式.静态代理;


interface Subject{
    public void request();
}

class ReaSubject implements Subject {
    public void request(){
        System.out.println("i am subject!");
    }
}

class Proxy implements Subject{
    Subject subject ;
    Proxy(Subject subject){
        this.subject = subject;
    }
    @Override
    public void request() {
        System.out.println("start proxy");
        subject.request();
        System.out.println("proxy stop");
    }
}


public class ProxyDemo {


    public static void main(String[] args) {
        Subject reaSubject = new ReaSubject();
        Proxy proxy = new Proxy(reaSubject);
        proxy.request();
    }

}


